package com.example.demo.mapper;

import com.example.demo.model.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface UserMapper {
    List<User> findAll();
    User findById(Long id);
    void insert(User user);
    void update(User user);
    void deleteById(Long id);
    List<User> findByName(String name);
    int countByEmail(@Param("email") String email, @Param("excludeId") Long excludeId);
    
    // 新增复杂查询方法
    List<User> findByCondition(@Param("name") String name,
                              @Param("email") String email,
                              @Param("gender") User.Gender gender,
                              @Param("startDate") LocalDate startDate,
                              @Param("endDate") LocalDate endDate);
} 